package com.ssy.lingxi.order.model.vo.mobile.response;

import com.ssy.lingxi.order.model.dto.MobileOrderQueryDTO;
import com.ssy.lingxi.order.utils.NumberUtil;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * App - （基础VO）查询订单列表时返回的VO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-02
 */
public class MobileOrderQueryVO implements Serializable {
    private static final long serialVersionUID = -3665763135608368118L;

    public MobileOrderQueryVO() {
    }

    public MobileOrderQueryVO(MobileOrderQueryDTO query) {
        this.orderId = query.getOrderId();
        this.orderNo = query.getOrderNo();
        this.orderMode = query.getOrderMode();
        this.vendorMemberId = query.getVendorMemberId();
        this.vendorRoleId = query.getVendorRoleId();
        this.vendorMemberName = query.getVendorMemberName();
        this.logo = query.getLogo();
        this.totalAmount = NumberUtil.formatAmount(query.getTotalAmount());
        this.quantities = NumberUtil.formatToInteger(query.getQuantities());
        this.innerStatus = query.getInnerStatus();
        this.innerStatusName = query.getInnerStatusName();
        this.outerStatus = query.getOuterStatus();
        this.outerStatusName = query.getOuterStatusName();
        this.products = query.getProducts().stream().map(MobileOrderProductQueryVO::new).collect(Collectors.toList());
    }

    /**
     * 订单Id
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 下单模式，10-积分订单，11-渠道积分订单，其他（说明略）
     */
    private Integer orderMode;

    /**
     * 供应会员Id
     */
    private Long vendorMemberId;

    /**
     * 供应会员角色Id
     */
    private Long vendorRoleId;

    /**
     * 店铺名称
     */
    private String vendorMemberName;

    /**
     * 店铺logo
     */
    private String logo;

    /**
     * 订单总额
     */
    private String totalAmount;

    /**
     * 订单商品总数量
     */
    private String quantities;

    /**
     * 内部状态枚举
     */
    private Integer innerStatus;

    /**
     * 内部状态名称
     */
    private String innerStatusName;

    /**
     * 外部状态枚举
     */
    private Integer outerStatus;

    /**
     * 外部状态名称
     */
    private String outerStatusName;

    /**
     * 订单商品列表
     */
    private List<MobileOrderProductQueryVO> products;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getOrderMode() {
        return orderMode;
    }

    public void setOrderMode(Integer orderMode) {
        this.orderMode = orderMode;
    }

    public Long getVendorMemberId() {
        return vendorMemberId;
    }

    public void setVendorMemberId(Long vendorMemberId) {
        this.vendorMemberId = vendorMemberId;
    }

    public Long getVendorRoleId() {
        return vendorRoleId;
    }

    public void setVendorRoleId(Long vendorRoleId) {
        this.vendorRoleId = vendorRoleId;
    }

    public String getVendorMemberName() {
        return vendorMemberName;
    }

    public void setVendorMemberName(String vendorMemberName) {
        this.vendorMemberName = vendorMemberName;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getQuantities() {
        return quantities;
    }

    public void setQuantities(String quantities) {
        this.quantities = quantities;
    }

    public Integer getInnerStatus() {
        return innerStatus;
    }

    public void setInnerStatus(Integer innerStatus) {
        this.innerStatus = innerStatus;
    }

    public String getInnerStatusName() {
        return innerStatusName;
    }

    public void setInnerStatusName(String innerStatusName) {
        this.innerStatusName = innerStatusName;
    }

    public Integer getOuterStatus() {
        return outerStatus;
    }

    public void setOuterStatus(Integer outerStatus) {
        this.outerStatus = outerStatus;
    }

    public String getOuterStatusName() {
        return outerStatusName;
    }

    public void setOuterStatusName(String outerStatusName) {
        this.outerStatusName = outerStatusName;
    }

    public List<MobileOrderProductQueryVO> getProducts() {
        return products;
    }

    public void setProducts(List<MobileOrderProductQueryVO> products) {
        this.products = products;
    }
}
